#include "test1.hpp"
#include "config.hpp"
#include "rander.hpp"
#include <cstddef>
#include <cstdio>

static auto _sep = "=================================================";

static void print_helper(size_t const a[], size_t const page[], size_t n) {
  for (size_t i = 0; i < n; ++i) {
    printf("a[%ld]=%ld ", i, a[i]);
  }
  printf("\n%s%s\n", _sep, _sep);
  for (size_t i = 0; i < n; ++i) {
    printf("page[%ld]=%ld ", i, page[i]);
  }
  printf("\n%s%s\n", _sep, _sep);
}

void test1() {
  rander rander(0, TEST1_MAX);
  size_t a[TEST1_SIZE], page[TEST1_SIZE];
  for (auto i = 0; i < TEST1_SIZE; ++i) {
    a[i] = rander.get_rand();
    page[i] = a[i] / PAGE_SIZE;
  }
  print_helper(a, page, TEST1_SIZE);
}